export default function config($stateProvider, $urlRouterProvider, $locationProvider, $httpProvider, tooltipsConfProvider) {
    tooltipsConfProvider.configure({
        'smart': true,
        'size': 'large',
        'speed': 'fast',
        'tooltipTemplateUrlCache': true
    });
    $locationProvider.html5Mode(false).hashPrefix('');
    /**注册拦截*/
    $httpProvider.interceptors.push('HttpInterceptor');

    let loginState = {
        name: 'login',
        url: '/login',
        template: require("../login.html"),
        controller: 'LoginController'
    };

    let mainstate = {
        name: 'main',
        url: '/main',
        template: require("../main.html")
    };

    /*
     * 主页
     * */
    let homePageState = {
        name: 'portal',
        url: "/portal",
        template: require('./views/portal.html'),
        controller: 'PortalController'
    };

    let bannerImageState = {
        name: 'bannerImage',
        url: '/bannerImage',
        cache: false,
        controllerAs: 'vm',
        template: require('./views/bannerImage.html'),
        controller: 'BannerImageController'
    };

    let globalSettingState = {
        name: 'globalSetting',
        url: '/globalSetting',
        cache: false,
        template: require('./views/globalSetting.html'),
        controller: 'GlobalSettingController'
    };

    //登录
    $stateProvider.state("login", loginState);
    $stateProvider.state("main", mainstate);
    //主页
    $stateProvider.state('main.portal', homePageState);
    //Banner　图片管理
    $stateProvider.state('main.bannerimage', bannerImageState);
    // 字典管理
    $stateProvider.state("main.globalSetting", globalSettingState);


    $urlRouterProvider.otherwise("/login");
}
config.$inject = ['$stateProvider', '$urlRouterProvider', '$locationProvider', '$httpProvider', 'tooltipsConfProvider'];
